﻿using System;

namespace BankSystem
{
    namespace BankingSystem
    {
        public class ATM
        {
            private Random random = new Random();

            public void Withdraw(Account account, double amount)
            {
                if (random.NextDouble() < 0.3) // 模拟30%的概率出现坏钞
                {
                    throw new BadCashException();
                }

                account.Withdraw(amount);
            }
        }
    }
}
